#include <iostream>
#include <vector>

#include "grade.h"

using namespace std;

vector<Student_info> extract_kalan(vector<Student_info>& s){

    vector<Student_info> gec,kal;

    for (vector<Student_info>::size_type i=0; i!=s.size(); i++){
        if (fgrade(s[i]))
            kal.push_back(s[i]);
        else
            gec.push_back(s[i]);

    s=gec;
    return kal;

    }
}

vector<Student_info> extract_kalan_list(list<Student_info>& s){

    list<Student_info> kal;
    list<Student_info>::iterator iter = s.begin();

    while (iter != s.end()){
        if (fgrade(*iter)) {
         kal.push_back(*iter);
         iter = s.erase(iter);
        }
        else
            iter++;

    }
    return kal;
}
